#ifndef SERIALPORTDIALOG_H
#define SERIALPORTDIALOG_H

#include <QDebug>
#include <QDialog>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include "UserData.h"

namespace Ui {
class serialPortDialog;
}

typedef struct
{
    QString name;
    qint32 baudRate;
    qint32 dataBits;
    qint32 parity;
    qint32 stopBits;
    qint32 flowControl;
} SerialPortData;

class SerialPortDialog : public QDialog
{
    Q_OBJECT
public:
    explicit SerialPortDialog(SerialPortData *pdata, QWidget *parent = 0);
    ~SerialPortDialog();

public slots:
    virtual void accept();

private:
    Ui::serialPortDialog *ui;
    SerialPortData  *m_pData;

    void initGui();
};

#endif // SERIALPORTDIALOG_H
